fix: Websocket error broadcast for unsubscribed ID#506
Merged
calvincestari merged 2 commits intomainfrom Oct 16, 2024
Merged
Conversation
Collaborator
✅ Docs Preview ReadyNo new or changed pages found. |
✅ Deploy Preview for eclectic-pie-88a2ba canceled.
|
✅ Deploy Preview for apollo-ios-docc canceled.
|
calvincestari
commented
Oct 16, 2024
| kind: .neitherErrorNorPayloadReceived) | ||
| responseHandler(.failure(websocketError)) | ||
| } | ||
| } else { |
Member
Author
There was a problem hiding this comment.
An alternative approach to silencing this error path is to move unsubscribing IDs into another array that can be checked against if the ID is not found in subscribers. This would ensure we're discarding a message for an unsubscribing handler but I'm not sold on that being necessary.
The unsubscribing array should be of [String] type since there would be no need to store the handling closure again.
BobaFetters
pushed a commit
that referenced
this pull request
Oct 16, 2024
BobaFetters
pushed a commit
to apollographql/apollo-ios
that referenced
this pull request
Oct 16, 2024
BobaFetters
pushed a commit
that referenced
this pull request
Oct 16, 2024
9d8aafbe fix: Websocket error broadcast for unsubscribed ID (#506) git-subtree-dir: apollo-ios git-subtree-split: 9d8aafbedece7483f397cb3a43f30f95892f840d
BobaFetters
pushed a commit
that referenced
this pull request
Oct 16, 2024
…bscribed ID git-subtree-dir: apollo-ios git-subtree-mainline: 05b5699 git-subtree-split: 9d8aafbedece7483f397cb3a43f30f95892f840d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes apollographql/apollo-ios#2274
Closes apollographql/apollo-ios#2447
There is a sequence of events where the caller unsubscribes which removes their ID from
subscribersbut an incoming message is then received for that subscriber. It doesn't seem correct to broadcast that as an error to all remaining subscribers for unrelated messages.Changes:
idfield in the messageidwas not found insubscribers.